
<%@page import="java.text.SimpleDateFormat,java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>轮播图删除</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/pintuer.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/admin.css">
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
</head>
<body>
	<form method="post" action="" id="listform">
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder"> 内容列表</strong> <a href=""
					style="float: right; display: none;">添加字段</a>
			</div>
		</div>
		<table class="table table-hover text-center">
			<tr>
				<th width="200">上传时间</th>
				<th width="200">图片预览</th>
				<th width="200">图片描述</th>
				<th width="200">操作</th>
			</tr>
			<c:forEach items="${info}" var="msg">
				<tr id="haha">
					<td><f:formatDate value="${msg.date}" pattern="yyyy年MM月dd日  " /></td>
					<td><img  src="${msg.path}" width="170px" height="100px" ></td>
					<td><c:out value="${msg.description}"></c:out></td>
					<td id="hello"><div class="button-group">
							<a class="button border-main " href="javascript:void(0)"
								onclick="deletePic('${msg.path}')"><span class="icon-edit"></span>删除</a>
						</div></td>
				</tr>

			</c:forEach>




		</table>
		</div>
	</form>
	<script type="text/javascript">
		//删除轮播图
		function deletePic(path) {
			
			$.ajax({
				type:"GET",
				url:"${pageContext.request.contextPath}/deletePic?path="+ path,
				success:function(data){
					if(data.result=="删除成功"){
						alert("删除成功");
						window.location.href = "${pageContext.request.contextPath}/enterPictureDelete";
					}
					else{
						alert("删除失败");
					}
				}		
			})
		}
	</script>
</body>
</html>